<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/FInclude/includeTaglibs.jsp"%>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<c:import url="/FInclude/backEndCssJs.jsp" />
	
	<style>
	.opt-head{height: 60px;}
	.opt-head button{margin: 10px;}
	.content{margin:10px;}
	tbody tr:hover{background-color: #E0E0E0;}
	.red{color: red;}
	.name{font-weight: bold;margin: 8px;color: red;}
	</style>
</head>

<body>

<div class="content">
	<table class="table">
		<thead>
			<tr>
				<th>题目</th>
				<th>&nbsp;</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${list }" var="news">
			<tr>
				<td><a href="${frontPath }/news/edit?newsId=${news.newsId }">${news.title }</a></td>
				<td>
					<button class="btn btn-sm btn-danger" del="${news.newsId }">删除</button>
								</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
</div>
<div class="well">
	<c:if test="${page.totalPage >1}">
		<p:PageCommonStyle frontPath='${frontPath}' displayNum='6' page="${page}" isDisplaySelect='false' isStyleBootstrap="true"/>
	</c:if>
	搜索共<span class="badge badge-info">${page.totalRecord }</span>条记录
</div>
<script>
	$("del").click(function(){
		var id = $(this).attr("del");
		$.box({title:"删除", message:"是否删除？",ok:function(){
		
			$.post("del.json",{newsId:id},function(data){
				$.box("删除成功");
			});
		}});
	});
</script>
</body>
</html>